package com.nov.multidatasource.service.impl;


import com.nov.multidatasource.dao.secondary.StudentMapper;
import com.nov.multidatasource.entity.secondary.Student;
import com.nov.multidatasource.service.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StudentServiceImpl implements StudentService {

  @Resource
  private StudentMapper studentMapper;

  @Override
  public void save() throws Exception {
    try {
      Student student = new Student();
      student.setName("student1");
      studentMapper.insert(student);
//      int i = 1 / 0;
    } catch (Exception e) {
      throw new Exception("保存异常B");
    }
  }
}
